package cn.itsource.hrm.task;

import cn.itsource.hrm.service.IKillCourseService;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class PublishKillCourse2RedisTask {
    @Autowired
    private IKillCourseService killCourseService;
    @Scheduled(cron = "*/10 * * * * ?") //cron表达式
    public void publishKillCourse2Redis(){
    //System.out.println(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
        killCourseService.publishKillCourse2Redis();
    }
}
